package com.sc.nft.dao;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import lombok.extern.slf4j.Slf4j;
import com.sc.nft.entity.PrizeDrawActivityRewards;
import com.sc.nft.mapper.PrizeDrawActivityRewardsMapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 抽奖活动-瓜分活动-奖励配置(sc_prize_draw_activity_rewards)数据DAO
 *
 * @author Sun
 * @since 2023-09-14 11:32:32
 * @description 由 Mybatisplus Code Generator 创建
 */
@Slf4j
@Repository
public class PrizeDrawActivityRewardsDao extends ServiceImpl<PrizeDrawActivityRewardsMapper, PrizeDrawActivityRewards> {

    public List<PrizeDrawActivityRewards> getListByActivityId(Long activityId) {
        LambdaQueryWrapper<PrizeDrawActivityRewards> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(PrizeDrawActivityRewards::getActivityId,activityId);
        wrapper.last("order by type asc");
        return list(wrapper);
    }
}